/**
 * 
 */
package org.cuatrovientos.erp.business;

import java.util.List;

import org.apache.log4j.Logger;
import org.cuatrovientos.erp.dao.IssueTypeDAOInterface;
import org.cuatrovientos.erp.model.Issue;
import org.cuatrovientos.erp.model.IssueType;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author reitxel
 *
 */
public class IssueTypeBO implements IssueTypeBOInterface {
	// Get log4j logger
	private static final Logger logger = Logger.getLogger(IssueTypeBO.class);
			
	@Autowired
	private IssueTypeDAOInterface issueTypeDAO;
		
		
	/**
	 * selectById
	 * @param int id
	 * @return IssueType with that id
	 */
	@Override
	public IssueType selectById(int id) {
		logger.info("selectById: " + id);
		return issueTypeDAO.selectById(id);
	}

	/**
	 * selectAll
	 * @return list of IssueTypes
	 */
	@Override
	public List<IssueType> selectAll() {
		logger.info("selectAll: ");
		return issueTypeDAO.selectAll();
	}

	/**
	 * search
	 * @param String name
	 * @return List of issue Types with that name
	 */
	@Override
	public List<IssueType> search(String name) {
		logger.info("search : " + name);
		return issueTypeDAO.search(name);
	}

	/**
	 * deleteById
	 * @param int id
	 */
	@Override
	public void deleteById(int id) {
		logger.info("delete by: " + id + " id");
		issueTypeDAO.deleteById(id);

	}

	/**
	 * insert
	 * @param issueType to insert
	 */
	@Override
	public void insert(IssueType issueType) {
		logger.info("insert: " + issueType);
		issueTypeDAO.insert(issueType);

	}

	/**
	 * update
	 * @param IssueType to update
	 */
	@Override
	public void update(IssueType issueType) {
		logger.info("update: " + issueType);
		issueTypeDAO.update(issueType);
	}

	/**
	 * delete
	 * @param issueType to delete
	 */
	@Override
	public void delete(IssueType issueType) {
		logger.info("delete: " + issueType);
		issueTypeDAO.delete(issueType);

	}

}
